@extends('web.layouts.app')

@section('styles')
    <link rel="stylesheet" type="text/css" href="{{ asset('resources/web/css/index.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ asset('resources/web/css/ucenter.css')}}">
@endsection

@section('content')
    <div class="uc-wrap swrap mt20">
        <div class="uc-side L">
            <div class="uc-nav">
                <ul>
                    @include('web.user_center.menu')
                </ul>
            </div>
        </div>
       <div class="uc-main uc-mainbg R">
		<!--菜单选项-->
		<ul class="user-main-top-tab">
			<li class="active"><a href="{{ action('UserCenter\UserCenterController@balanceOfPayments', ['menu' => 5]) }}">收支明细</a></li>
			<li><a href="{{ action('UserCenter\UserCenterController@rechargeRecord',['menu' => 5]) }}">充值记录</a></li>
			<li><a href="{{ action('UserCenter\UserCenterController@presentRecord',['menu' => 5]) }}">提现记录</a></li>
		</ul>
		<!--查询表单-->
		<div class="user-time-search ml20">
			<form method="get" action="{{ action('UserCenter\UserCenterController@balanceOfPayments') }}">
				<span>起止日期</span>
				<input type="text" name="startTime" value="{{ $query['startTime'] }}" class="date-txt Wdate" onclick="WdatePicker();"> -
				<input type="text" name="endTime" value="{{ $query['endTime'] }}" class="date-txt Wdate" onclick="WdatePicker();">
				<input type="submit" class="btn" value="搜索">
			</form>
		</div>
		<!--列表-->
		<div class="user-item-list">
			<ul class="data-list deal-log-list">
				<li class="th">
					<div class="col-time">交易时间</div>
					<div class="col-name-tips">交易名称<i> | </i>备注</div>
					<div class="col-income">收入</div>
					<div class="col-expenditure">支出</div>
					<div class="col-balance">账户余额</div>
				</li>
				@forelse($data as $d)
					<li>
						<div class="col-time">{{ $d->pay_time??'--' }}</div>
						<div class="col-name-tips"><i> {{ $d->remarks??'--' }} </i></div>
						<div class="col-income">
							@if( $d->receive_user == $user->id || $d->type == 4)
								{{ $d->money }}
							@else
								--
							@endif
						</div>
						<div class="col-expenditure">
							@if($d->pay_user == $user->id && $d->type != 4)

								-{{ $d->money }}

							@else

								--

							@endif

						</div>
						<div class="col-balance">

							@if( $d->receive_user == $user->id || $d->type == 4)
								--
								<!-- {{ $d->money }} -->
							@else
								{{ $d->user_balance??0 }}
							@endif
						</div>
					</li>
					
				@empty
				@endforelse
			</ul>
			<div class="uc-page-box text-right">
				{!! $links !!}
			</div>
		</div>
		</div>

</div>
@endsection

@section('scripts')
    <script src="{{ asset('resources/web/js/index.js') }}"></script>
	<script type="text/javascript" src="{{ asset('resources/web/plugins/datePicker/WdatePicker.js')}}"></script>
@endsection